<template>
	<view>
		<image style="width: 100%;"
			:src="base+'/prod-api/profile/upload/image/2022/03/14/b86fa8e1-b556-48a5-893e-e47f0dcbd6a1.jpg'" mode="">
		</image>
		<view class="u-p-10">
			{{yihzan[0].introduce}}
		</view>
		<view class="item-container">
			<view class="thumb-box" v-for="(item1, index1) in rencai" :key="index1"
				@click="dianji2(item1.id)">
				<image class="item-menu-image" :src="base+item1.imgUrl" ></image>
				<view class="item-menu-name u-text-center">{{item1.name}}</view>
			</view>
		</view>
		<uni-group title="青年驿站列表">
			<uni-card v-for="(item,index) in yihzan" :title="item.name" :thumbnail="base+item.coverImgUrl">
				<view @click="dianji(item.id)">
					<view>男剩余床位数：{{item.bedsCountBoy}}</view>
					<view>女剩余床位数：{{item.bedsCountGirl}}</view>
					<view>详细地址：{{item.address}}</view>
				</view>
				<uni-collapse>
					<uni-collapse-item title="站点介绍">
						<view class="u-padding-10">
							{{item.introduce}}
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</uni-card>
		</uni-group>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base: api.baseurl,
				yihzan: [],
				rencai: ''
			}
		},
		onLoad() {
			this.getlun()
			this.getlun2()
		},
		methods: {
			dianji2(id){
				uni.navigateTo({
					url:'rencaixin?id='+id
				})
			},
			dianji(id) {
				uni.navigateTo({
					url: 'yihznxianq?id=' + id
				})
			},
			getlun() {
				this.$get(this.base + '/prod-api/api/youth-inn/youth-inn/list', ).then((res) => {
					this.yihzan = res.rows
					console.log(res.rows[0])
				})
			},
			getlun2() {
				this.$get(this.base + '/prod-api/api/youth-inn/talent-policy-area/list').then((res) => {
					this.rencai = res.data
				})
			}
		}
	}
</script>

<style>
	.item-container {
		display: flex;
		flex-wrap: wrap;
	}

	.thumb-box {
		width: 33.333333%;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 20rpx;
	}

	.item-menu-image {
		width: 120rpx;
		height: 120rpx;
	}
</style>
